package com.example.demosdk;
import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.WinDef;
import com.sun.jna.ptr.FloatByReference;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;

import java.util.Arrays;
import java.util.List;
public interface DLFrameSDK extends StdCallLibrary{

    int IFR_Next(Pointer hHandle); //单帧前进
    int IFR_MemSaveToDLI(Pointer hHandle,String cFileName);            //HANDLE  内存中的红外原始数据转为DLI格式
    int IFR_LoadFile(WinDef.HWND WndWindow,String cFileName, int iFileType, long BeginTime, long EndTime); //装载录像文件
    int IFR_LoadInfraredParamFromStream(int hHandle,Pointer pBuf); //HANDLE 从内存中加载参数
    int IFR_LoadBuffer(WinDef.HWND WndWindow, Pointer IRBuff, int BuffLen); //从内存中加载红外文件，功能与loadFile一样 IRBuff：存放红外文件的内存空间
    int IFR_MemSaveToBuff(int hHandle, Pointer pBuff, int BuffLen);  //内存中的红外原始数据转为内存buff
    int IFR_GetImageWidthHeight(int hHandle, IntByReference nWidth, IntByReference nHeight);
    float IFR_GetPointTemp(int hHandle, POINT Spot);    //HANDLE m_hHandle
    int IFR_LoadInfraredData(int hHandle,Pointer InfraredData);   // HANDLE hHandle  INT8U *InfraredData
    int IFR_GetRectMinMaxTemp(Pointer hHandle, POINT Spot1, POINT Spot2, Pointer MinTemp, POINT MinSpot, Pointer MaxTemp, POINT MaxSpot);
                             // HANDLE hHandle 输入矩形左边，输出最高温度，返回值 float *MaxTemp
    int IFR_GetSDKVersion(WinDef.HWND hHandle);


    class POINT extends Structure{
        public long x;
        public long y;
        public  static class ByReference extends POINT implements Structure.ByReference {}
        public  static class ByValue extends POINT implements Structure.ByValue{}
        @Override
        protected List<String> getFieldOrder() {
            return Arrays.asList(new String[] {"x","y"});
        }
    }
}



